package pack3;

class Cube extends Shape {
    private double x;
    private double y;
    private double length;
    private double width;
    private double height;

    public Cube(double x, double y, double length, double width, double height) {
        this.x = x;
        this.y = y;
        this.length = length;
        this.width = width;
        this.height = height;
        name = "Cube";
    }

    @Override
    public double calculateArea() {
        return 2 * (length * width + length * height + width * height);
    }

    @Override
    public double calculatePerimeter() {
        return 4 * (length + width + height);
    }

    @Override
    public void show() {
        System.out.println("长方体: 底面中心位置 [" + x + "," + y + "], width = " + width + ", length = " + length + ", height = " + height);
    }
}
